//
//  BookManager.m
//  作业3
//
//  Created by dllo on 16/7/6.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "BookManager.h"

@implementation BookManager
- (NSMutableArray *)addBook:(Book *)book {
    [self.bookArr addObject:book];
    return _bookArr;
}
- (NSMutableArray *)delBook:(Book *)book {
    [self.bookArr removeObject:book];
    return _bookArr;
}
- (void)checkName:(NSString *)name
            price:(CGFloat)price {
    BOOL isFind = NO;
    for (Book *book in self.bookArr) {
        if ([book.bookName isEqualToString:name]) {
            book.price = price;
            isFind = YES;
        }
    }
    if (isFind == YES) {
        NSLog(@"有这本书,价格已修改");
    } else {
        NSLog(@"没有这本书");
    }
}

- (void)showBooks {
    for (Book *book in self.bookArr) {
        NSLog(@"书名<<%@>>",book.bookName);
    }
}

@end
